import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import UserManage from '../views/sys/user/SysUser'
import SysBasis from '../views/sys/basis/SysBasis'
import SysMenu from '../views/sys/menu/SysMenu'
import SysCompany from '../views/sys/company/SysCompany'
import SysRole from '../views/sys/role/SysRole'
import SysDept from '../views/sys/dept/SysDept'
import CusCustomerList from '../views/cus/customer_list/CusCustomerList'

const routes = [
  {
    path: '/',
    name: '首页',
    component: Home
  },{
    path: '/login',
    name: '登录',
    component: Login,
  },{
    path: '/sys',
    name: '系统配置',
    component: Home,
    children:[
      {
        path: 'menu',
        name: '菜单管理',
        component: SysMenu,
      },
      {
        path: 'user_center',
        name: '个人中心',
        component: () => import('../views/sys/center/UserCenter')
      },
      {
        path: 'role',
        name: '角色管理',
        component: SysRole,
      },
      {
        path: 'company',
        name: '企业管理',
        component: SysCompany,
      },
      {
        path: 'user',
        name: '用户管理',
        component: UserManage,
      },
      {
        path: 'basis',
        name: '基础信息',
        component: SysBasis,
      },
      {
        path: 'dept',
        name: '组织架构',
        component: SysDept,
      }
    ]
  },{
    path: '/cus',
    name: '客户管理',
    component: Home,
    children:[
      {
        path: 'customer_list',
        name: '客户列表',
        component: CusCustomerList,
      }
    ]
  },{
    path: '/cms',
    name: '内容管理',
    component: Home,
    children:[
      {
        path: 'news',
        name: '新闻管理',
        component: () => import('../views/cms/news/NewsList')
      },
      {
        path: 'recommend',
        name: '推荐管理',
        component: () => import('../views/cms/recommend/RecommendList')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
